//
//  UIControl+ActionEvent.m
//  JCSwizzle
//
//  Created by gome on 2018/5/23.
//  Copyright © 2018年 JC. All rights reserved.
//

#import "UIControl+ActionEvent.h"
#import "NSObject+Swizzle.h"

@implementation UIControl (ActionEvent)

+ (void)load {
    [self exchangeOriginMethod:@selector(sendAction:to:forEvent:) newMethod:@selector(jc_sendAction:to:forEvent:)];
}

- (void)jc_sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event {
    
    NSString *actionName = NSStringFromSelector(action);
    NSString *targetName = NSStringFromClass([target class]);
    
    NSLog(@"\naction\n%@ target\n%@ uievent\n%@", actionName, targetName, event);
    
    [self jc_sendAction:action to:target forEvent:event];
}
@end
